package edu.xidian.forum.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class RegisterDto implements Serializable {

    @NotEmpty
    @Length(min = 2, max = 15, message = "The account name should be between 2 and 15")
    private String name;

    @NotEmpty
    @Length(min = 6, max = 20, message = "Password length should be between 6 and 20")
    private String password;

    @NotEmpty
    @Length(min = 6, max = 20, message = "Password length should be between 6 and 20")
    private String checkPassword;

    @NotEmpty
    @Email(message = "Wrong Email address")
    private String email;
}
